package com.work.rabbitmqdemo.receiver;

import com.work.rabbitmqdemo.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
/*
* 消息接受者
* */
@Component
public class MessageReceiver {


    @RabbitListener(queues = RabbitMQConfig.QUEUE_NAME)
    public void receiveMessage(String message) {
        System.out.println("Received <" + message + ">");
    }
}
